<template>
    <div>
        <div class="mui-numbox" data-numbox-min="1" >
            <button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
            <input readonly @change="countchange" id="test" class="mui-input-numbox" type="number" :value="goodcount" ref="numbox">
            <button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
		</div>
    </div>
</template>

<script>
import mui from '../lib/mui/js/mui.min.js'

export default {
    mounted(){
        // 初始化数字选择框组件
        mui(".mui-numbox").numbox()
    },
    methods:{
        countchange(){
            console.log(this.$refs.numbox.value)
            this.$store.commit("updatagoodinfo",{
                id:this.goodid,count:this.$refs.numbox.value
            })
        }
    },
    props:["goodcount","goodid"]
   
}
</script>

<style lang="scss" scoped>

</style>
